package com.zt.dev.userManage.entity.enumvo;

public enum RoleEnum {

    ADMINISTOR(0,"管理员"),
    ORGANIZATOR(1,"组织人员"),
    SECUTITOR(2,"保障人员"),
    TECHNOLOGER(3,"技术人员");

    private Integer code;
    private String type;

    RoleEnum(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static Integer getCode(String type){
        for(RoleEnum roleEnum : RoleEnum.values()){
            if(roleEnum.getType().equals(type)){
                return roleEnum.code;
            }
        }
        return null;
    }
    public static String getType(Integer code){
        for(RoleEnum roleEnum : RoleEnum.values()){
            if(roleEnum.getCode().equals(code) ){
                return roleEnum.type;
            }
        }
        return null;
    }
}
